package org.vaadin.nf4v.ext.runtime.secure;

/**
 * Security manager interface provides basic security methods.
 * Implementation may rely on any security framework.
 */
public interface ISecurityManager {

    /**
     *
     * @return true if user is logged in, false otherwise
     */
    boolean isLoggedIn();

    /**
     * Note: return always true if application security rely only on permissions
     * @param role role name
     * @return true if user has role, false otherwise
     */
    boolean hasRole(String role);

    /**
     * Note: return always true if application security rely only on roles
     * @param permission permission name
     * @return true if user has permission, false otherwise
     */
    boolean hasPermission(String permission);
}
